import time
import os

from selenium import webdriver

driver = webdriver.Chrome()
driver.get('https://www.baidu.com')
driver.maximize_window()
# 截图
# image文件夹的绝对路径
print(os.path.abspath('test'))
image_path = os.path.abspath('test')
name = "error_{}.png".format(time.strftime("%Y_%m_%d_%H_%M_%S"))
image_name = os.path.join(image_path,name)
driver.get_screenshot_as_file(image_name)